# 添加了以来
# pip install fastapi
# pip install uvicorn[standard]

from fastapi import FastAPI, Path, Query, Form
from fastapi.staticfiles import StaticFiles
from fastapi_offline import FastAPIOffline
import uvicorn
from pydantic import BaseModel

from api.user import user_api
from api.news import news_api

app = FastAPIOffline(
    docs_url="/docs",
    redoc_url=None,
    title="项目名称",
    version="1.0.1",
    description="项目介绍"
)

# api路由
app.include_router(user_api, tags=['用户接口'])
app.include_router(news_api, tags=['新闻接口'])

# 静态文件路由
app.mount("/www", StaticFiles(directory="C:\\Users\\Administrator\\Desktop\\web\\fastapi\\www"), name="www")

if __name__ == '__main__':
    uvicorn.run(
        'demo00:app', 
        host = '0.0.0.0', 
        port = 8088, 
        reload = True
    )
